define(["app", "angular", "services/BaseService"], function(app, angular) {
	
	var deps = ["$http", "BaseService"];
	
	function auhtorityResource($http, BaseService) {
        return initResource($http, BaseService.restfulUrl + "conferenceAuthority/", BaseService.formHeader);
    }
	
	var postHeader = {
	        "Content-Type" : "application/x-www-form-urlencoded;charset=utf-8"
	};
	
	function initResource($http, preUrl,formHeader) {
        return {
        	updateAuthority: function (chooseUserId,companyCode,chooseType,timeChoose) {
        		return $http.post(preUrl+"updateAuthority",{
        			chooseUserId:chooseUserId,
                    companyCode:companyCode,
                    chooseType:chooseType,
                    timeChoose:timeChoose
                },{
                    headers: postHeader
                });
			},
        	queryUserAuthority: function (chooseUserId,companyCode) {
        		return $http.get(preUrl + "queryUserAuthority", {
                    params: {
                    	chooseUserId: chooseUserId,
                    	companyCode: companyCode
                    }
                });
			}
        };
        
    }
	auhtorityResource.$inject = deps;
	app.lazy.factory("EditAuthorityResource", auhtorityResource);
});
